package dryven.model.binding.fieldset;

import dryven.model.validation.Validator;
import dryven.view.Formatter;

public interface Field {
	public enum Access {Const, Read, Write};
	
	public String getName();
	public Object getValue(Object model);
	public Class<?> getValueType();
	public void setValue(Object model, Object value);
	/**
	 * Does this method return a String because it does not necessarily
	 * needs to be a classname or to avoid loading the
	 * class/triggering any static constructors??
	 * @return
	 */
	public String getViewComponentClass();
	public Access getAccess();
	public Class<? extends Validator> getValidatorClass();
	public Class<? extends Formatter> getFormatterClass();
	public boolean isRequired();
	/**
	 * This method returns a String and not a class to allow
	 * model classes to represent more then one "model type"
	 * (e.g. dynamically). This raises the problem how to
	 * create a model class dynamically which is an open
	 * question.
	 * @return
	 */
	//public Object newModelInstance();
	public Class<?> getModelType();
	public int getMaxLength();
	public String getUniqueName();
}
